import { getshoplist } from "../../api/login";
const topCategory = [
    '居家',
    '美食',
    '服饰',
    '母婴',
    '个护',
    '严选',
    '数码',
    '运动',
    '杂货'
]
const state = {
    list: topCategory.map(item => ({ name: item }))
}
const mutations = {
    setlist(state, value) {
        state.list = value
    }
}
const actions = {
    async getList({ commit }) {
        const res = await getshoplist()
        console.log(res);
        // 获取数据成功，提交mutations进行数据修改
        commit('setlist', res.data.result)
    }
}
export default {
    namespaced: true,
    state,
    mutations,
    actions
}